package com.yoj.serviceclient.service.sandbox;

import com.yoj.model.codesandbox.ExecuteCodeRequest;
import com.yoj.model.codesandbox.ExecuteCodeResponse;
import com.yoj.serviceclient.service.sandbox.fallback.SandboxFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "yoj-code-sandbox", path = "/rpc", fallback = SandboxFeignClientFallback.class)
public interface SandboxFeignClient {

    /**
     * 调用代码沙箱接口执行代码
     */
    @PostMapping("/executeCode")
    ExecuteCodeResponse executeCode(@RequestBody ExecuteCodeRequest executeCodeRequest);
}